package com.trkj.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;


/**
 * The persistent class for the SALARY_PROJECT database table.
 * 
 */
@Entity
@Table(name="SALARY_PROJECT")
@NamedQuery(name="SalaryProject.findAll", query="SELECT s FROM SalaryProject s")
public class SalaryProject implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="SALARY_PROJECT_PROJECTID_GENERATOR", sequenceName="HR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SALARY_PROJECT_PROJECTID_GENERATOR")
	@Column(name="PROJECT_ID")
	private long projectId;
	@JSONField(format="yyyy-MM-dd HH:mm:ss")
	@Column(name="PROJECT_CREATORDATE")
	private Timestamp projectCreatordate;

	@Column(name="PROJECT_FORMULA")
	private String projectFormula;

	@Column(name="PROJECT_MONEY")
	private BigDecimal projectMoney;

	@Column(name="PROJECT_NAME")
	private String projectName;

	@Column(name="PROJECT_PERSON")
	private String projectPerson;

	@Column(name="PROJECT_SOURCE")
	private String projectSource;
	@JSONField(format="yyyy-MM-dd HH:mm:ss")
	@Column(name="PROJECT_UPDATEDATE")
	private Timestamp projectUpdatedate;

	//bi-directional many-to-one association to ProjectShuju
	@OneToMany(mappedBy="salaryProject")
	@JSONField(serialize=false)
	private List<ProjectShuju> projectShujus;

	//bi-directional many-to-one association to SalaryChange
	@OneToMany(mappedBy="salaryProject")
	@JSONField(serialize=false)
	private List<SalaryChange> salaryChanges;

	//bi-directional many-to-many association to ProjectTemplate
	@ManyToMany
	@JoinTable(
		name="RELATIONSHIP_71"
		, joinColumns={
			@JoinColumn(name="PROJECT_ID")
			}
		, inverseJoinColumns={
			@JoinColumn(name="TEMPLATE_ID")
			}
		)
	@JSONField(serialize=false)
	private List<ProjectTemplate> projectTemplates;

	public SalaryProject() {
	}

	public long getProjectId() {
		return this.projectId;
	}

	public void setProjectId(long projectId) {
		this.projectId = projectId;
	}

	public Timestamp getProjectCreatordate() {
		return this.projectCreatordate;
	}

	public void setProjectCreatordate(Timestamp projectCreatordate) {
		this.projectCreatordate = projectCreatordate;
	}

	public String getProjectFormula() {
		return this.projectFormula;
	}

	public void setProjectFormula(String projectFormula) {
		this.projectFormula = projectFormula;
	}

	public BigDecimal getProjectMoney() {
		return this.projectMoney;
	}

	public void setProjectMoney(BigDecimal projectMoney) {
		this.projectMoney = projectMoney;
	}

	public String getProjectName() {
		return this.projectName;
	}

	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}

	public String getProjectPerson() {
		return this.projectPerson;
	}

	public void setProjectPerson(String projectPerson) {
		this.projectPerson = projectPerson;
	}

	public String getProjectSource() {
		return this.projectSource;
	}

	public void setProjectSource(String projectSource) {
		this.projectSource = projectSource;
	}

	public Timestamp getProjectUpdatedate() {
		return this.projectUpdatedate;
	}

	public void setProjectUpdatedate(Timestamp projectUpdatedate) {
		this.projectUpdatedate = projectUpdatedate;
	}

	public List<ProjectShuju> getProjectShujus() {
		return this.projectShujus;
	}

	public void setProjectShujus(List<ProjectShuju> projectShujus) {
		this.projectShujus = projectShujus;
	}

	public ProjectShuju addProjectShujus(ProjectShuju projectShujus) {
		getProjectShujus().add(projectShujus);
		projectShujus.setSalaryProject(this);

		return projectShujus;
	}

	public ProjectShuju removeProjectShujus(ProjectShuju projectShujus) {
		getProjectShujus().remove(projectShujus);
		projectShujus.setSalaryProject(null);

		return projectShujus;
	}

	public List<SalaryChange> getSalaryChanges() {
		return this.salaryChanges;
	}

	public void setSalaryChanges(List<SalaryChange> salaryChanges) {
		this.salaryChanges = salaryChanges;
	}

	public SalaryChange addSalaryChange(SalaryChange salaryChange) {
		getSalaryChanges().add(salaryChange);
		salaryChange.setSalaryProject(this);

		return salaryChange;
	}

	public SalaryChange removeSalaryChange(SalaryChange salaryChange) {
		getSalaryChanges().remove(salaryChange);
		salaryChange.setSalaryProject(null);

		return salaryChange;
	}

	public List<ProjectTemplate> getProjectTemplates() {
		return this.projectTemplates;
	}

	public void setProjectTemplates(List<ProjectTemplate> projectTemplates) {
		this.projectTemplates = projectTemplates;
	}

}